package com.sky.module.system.user.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sky.module.system.user.domain.entity.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author zsg
 * @since 2023-02-20
 */
@Repository
@Mapper
public interface UserMapper extends BaseMapper<User> {
    /**
     * 删除用户角色关系
     *
     * @param userId
     * @return
     */
    @Delete("delete from sys_user_role where user_id=#{userId}")
    int deleteUserRole(Long userId);


    int saveUserRole(@Param("userId") Long userId, @Param("roleIds") List<Long> roleIds);

}
